What is Load Balancing?
A load balancer is an application or device distributing incoming network traffic across two or more servers. Load balancing increased the availability of applications.
A load balancing application is used between the client and the server. Load balancer accepts a request from the client and transfers to a server with predefined algorithms.
Load Balancing Types
Every load balancer follows a predefined algoriths to select appropriate backend server for every requests. Mainly there are 3 types are load balancing algorithms used.
- Round Robin – Distributed the request to each server one by one.
- Least Connections – Distributed the request to the specific instance with the minimum connections.
- Source/IP Hash – Here we predefined the backend server based on client identity like IP address.
How Load Balancing Works
- A load balancer can be an application running on an operating system or a hardware device.
- The load balancer accepts requests from the users over the world wide web.
- One or more application servers (also known as a node) is connected to this load balancer.
- Load balancer maintains a pool of healthy hosts. It sends a health check requests to each backend nodes on every defined time (eg 1 min). If any backend node not answered, Load balancer removes it from the pool and stop all user requests to this instance.
- When load balancer gets user requests, it sends this request to one of the backend server using the predefined algorithms.